
<script type="text/javascript">
function pic_upload_success(file, data) {
    var json = $.parseJSON(data)
    
    $(this).bjuiajax('ajaxDone', json)
    if (json[BJUI.keys.statusCode] == BJUI.statusCode.ok) {
        $('#j_custom_pic').val(json.filename).trigger('validate')
        $('#j_custom_span_pic').html(json.filename)
    }
}
function do_OK(json, $form) {
    console.log(json)
    console.log($form)
}
//护照有效日期  = 签发日期 + 10年
$('#j_custom_issuedate').on('afterchange.bjui.datepicker', function(e, data) {
    var pattern = 'yyyy-MM-dd'
    var start   = end = data.value
    
    end.setFullYear(start.getFullYear() + 10)
    end.setDate(start.getDate() - 1)
    
    $('#j_custom_indate').val(end.formatDate(pattern))
})
</script>

<div class="bjui-pageContent">
    <form action="{:U('Theme/add')}" id="j_custom_form" data-toggle="validate" data-alertmsg="false">
        <table class="table table-condensed table-hover" width="100%">
            <tbody>
                <tr>
                    <td>
                        <label for="j_custom_passportno" class="control-label x85"><?php echo L("style_identity")?>：</label>
                        <input type="text" name="name" id="j_custom_passportno" value="" data-rule="required" size="15">
                    </td>
                </tr>
                <tr>
                    <td>
                        <label class="control-label x85"><?php echo L("upload_file")?>：</label>
                        <div style="display: inline-block; vertical-align: middle;">
                            <div id="j_custom_pic_up" data-toggle="upload" data-uploader="{:U('Theme/ajaxUpload')}" 
                                data-file-size-limit="1024000000"
                                data-file-type-exts="*.zip"
                                data-multi="true"
                                data-on-upload-success="pic_upload_success"
                                data-icon="cloud-upload"></div>
                            <input type="hidden" name="file" value="" id="j_custom_pic">
                            <span id="j_custom_span_pic"></span>
                        </div>
                    </td>
                </tr>
            </tbody>
        </table>

        
    </form>
</div>
<div class="bjui-pageFooter">
    <ul>
        <li><button type="button" class="btn-close" data-icon="close">取消</button></li>
        <li><button type="submit" class="btn-default" data-icon="save">保存</button></li>
    </ul>
</div>